﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ECare.BUS;
using ECare.BUS.Data;

namespace ECare.Client.controls
{
    public partial class ucPlanInfo : UserControl
    {
        public ucPlanInfo()
        {
            InitializeComponent();
            this.Load += ucPlanInfo_Load;
        }

        void ucPlanInfo_Load(object sender, EventArgs e)
        {
            if (this.Plan != null)
            {
                this.lblFormula.Text = string.Format(this.lblFormula.Text,FormulaHelper.GetFormulaInfoById(this.Plan.formula_id));
                this.lblDate.Text = string.Format(this.lblDate.Text, this.Plan.plan_date.ToShortDateString());
                this.lblTimes.Text = string.Format(this.lblTimes.Text, this.Plan.plan_times);

                this.lblOperateInfo.Text = string.Format(this.lblOperateInfo.Text,UserInfoHelper.GetUserNameById(this.Plan.plan_create_by),this.Plan.plan_create_time);
                this.lblUpdateInfo.Text = string.Format(this.lblUpdateInfo.Text,UserInfoHelper.GetUserNameById( this.Plan.plan_update_by),this.Plan.plan_update_time);
            }
        }


        public PlanInfo Plan { get; set; }
    }
}
